using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Generalization
{
    /// <summary>
    /// <para>Eliminate Polygon Part</para>
    /// <para>Creates a new output feature class containing the features from the input polygons with some parts or holes of a specified size deleted.</para>
    /// <para>创建一个新的输出要素类，其中包含输入面中的要素，并删除了指定尺寸的某些零件或孔。</para>
    /// </summary>    
    [DisplayName("Eliminate Polygon Part")]
    public class EliminatePolygonPart : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public EliminatePolygonPart()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The input feature class or layer whose features will be copied to the output feature class, with some parts or holes eliminated.</para>
        /// <para>输入要素类或图层，其要素将复制到输出要素类，并消除某些零件或孔。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class containing the remaining parts.</para>
        /// <para>包含其余部分的输出面要素类。</para>
        /// </param>
        public EliminatePolygonPart(object _in_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Eliminate Polygon Part";

        public override string CallName => "management.EliminatePolygonPart";

        public override List<string> AcceptEnvironments => ["MDomain", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "configKeyword", "extent", "geographicTransformations", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _condition.GetGPValue(), _part_area, _part_area_percent, _part_option.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The input feature class or layer whose features will be copied to the output feature class, with some parts or holes eliminated.</para>
        /// <para>输入要素类或图层，其要素将复制到输出要素类，并消除某些零件或孔。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output polygon feature class containing the remaining parts.</para>
        /// <para>包含其余部分的输出面要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Condition</para>
        /// <para><xdoc>
        ///   <para>Specify how the parts to be eliminated will be determined.</para>
        ///   <bulletList>
        ///     <bullet_item>Area—Parts with an area less than that specified will be eliminated.</bullet_item><para/>
        ///     <bullet_item>Percent—Parts with a percent of the total outer area less than that specified will be eliminated.</bullet_item><para/>
        ///     <bullet_item>Area and percent—Parts with an area and percent less than that specified will be eliminated. Only if a polygon part meets both the area and percent criteria will it be deleted.</bullet_item><para/>
        ///     <bullet_item>Area or percent—Parts with an area or percent less than that specified will be eliminated. If a polygon part meets either the area or percent criteria, it will be deleted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何确定要消除的部件。</para>
        ///   <bulletList>
        ///     <bullet_item>面积 （Area） - 面积小于指定面积的零件将被淘汰。</bullet_item><para/>
        ///     <bullet_item>百分比 （Percent） - 将消除总外部面积的百分比小于指定面积的零件。</bullet_item><para/>
        ///     <bullet_item>面积和百分比 - 面积和百分比小于指定面积和百分比的零件将被淘汰。只有当面零件同时满足面积和百分比条件时，才会将其删除。</bullet_item><para/>
        ///     <bullet_item>面积或百分比 - 面积或百分比小于指定面积或百分比的零件将被消除。如果面零件满足面积或百分比条件，则该零件将被删除。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Condition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _condition_value _condition { get; set; } = _condition_value._AREA;

        public enum _condition_value
        {
            /// <summary>
            /// <para>Area</para>
            /// <para>Area—Parts with an area less than that specified will be eliminated.</para>
            /// <para>面积 （Area） - 面积小于指定面积的零件将被淘汰。</para>
            /// </summary>
            [Description("Area")]
            [GPEnumValue("AREA")]
            _AREA,

            /// <summary>
            /// <para>Percent</para>
            /// <para>Percent—Parts with a percent of the total outer area less than that specified will be eliminated.</para>
            /// <para>百分比 （Percent） - 将消除总外部面积的百分比小于指定面积的零件。</para>
            /// </summary>
            [Description("Percent")]
            [GPEnumValue("PERCENT")]
            _PERCENT,

            /// <summary>
            /// <para>Area and percent</para>
            /// <para>Area and percent—Parts with an area and percent less than that specified will be eliminated. Only if a polygon part meets both the area and percent criteria will it be deleted.</para>
            /// <para>面积和百分比 - 面积和百分比小于指定面积和百分比的零件将被淘汰。只有当面零件同时满足面积和百分比条件时，才会将其删除。</para>
            /// </summary>
            [Description("Area and percent")]
            [GPEnumValue("AREA_AND_PERCENT")]
            _AREA_AND_PERCENT,

            /// <summary>
            /// <para>Area or percent</para>
            /// <para>Area or percent—Parts with an area or percent less than that specified will be eliminated. If a polygon part meets either the area or percent criteria, it will be deleted.</para>
            /// <para>面积或百分比 - 面积或百分比小于指定面积或百分比的零件将被消除。如果面零件满足面积或百分比条件，则该零件将被删除。</para>
            /// </summary>
            [Description("Area or percent")]
            [GPEnumValue("AREA_OR_PERCENT")]
            _AREA_OR_PERCENT,

        }

        /// <summary>
        /// <para>Area</para>
        /// <para>Eliminate parts smaller than this area.</para>
        /// <para>消除小于此面积的零件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _part_area { get; set; } = null;


        /// <summary>
        /// <para>Percentage</para>
        /// <para>Eliminate parts smaller than this percentage of a feature's total outer area.</para>
        /// <para>消除小于要素总外部面积百分比的零件。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Percentage")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _part_area_percent { get; set; } = 0;


        /// <summary>
        /// <para>Eliminate contained parts only</para>
        /// <para><xdoc>
        ///   <para>Determines what parts can be eliminated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked - Only parts totally contained by other parts can be eliminated. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked - Any parts can be eliminated.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定可以消除哪些部件。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 只有完全被其他部件包含的部件才能被淘汰。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 可以消除任何部件。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Eliminate contained parts only")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _part_option_value _part_option { get; set; } = _part_option_value._true;

        public enum _part_option_value
        {
            /// <summary>
            /// <para>CONTAINED_ONLY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CONTAINED_ONLY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ANY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ANY")]
            [GPEnumValue("false")]
            _false,

        }

        public EliminatePolygonPart SetEnv(object MDomain = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}